package top.kaoshanji.r7ch14a;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests;
import org.testng.annotations.Test;
import top.kaoshanji.r7ch14a.domain.Forum;

/**
 * 代码清单test-r7ch14a-479页c：测试一下使用SqlSessionTemplate调用MyBatis映射文件SQL语句
 * @author kaoshanji
 * ^_^
 * create time 2025/5/12 14:13
 */
@ContextConfiguration(locations = {"classpath:r7ch14a/application-context.xml"})
public class ForumMybatisTemplateDaoTest extends AbstractTransactionalTestNGSpringContextTests {

    @Autowired
    private ForumMybatisTemplateDao forumMybatisTemplateDao;

    @Test
    public void getForum() {
        Forum forum = forumMybatisTemplateDao.getForum(88813);
        System.out.println("=======看看输出=======");
        System.out.println(forum);
    }

    @Test
    public void getForumNum() {
        System.out.println("=======看看输出=======");
        System.out.println(forumMybatisTemplateDao.getForumNum());
    }

}
